﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;

namespace ThongBao
{
    public partial class FrmThongBaoOk : Office2007Form
    {
        public FrmThongBaoOk()
        {
            InitializeComponent();
        }

        static FrmThongBaoOk frmThongbao;

        /// <summary>
        /// Tạo thông báo
        /// </summary>
        /// <param name="_TenTB">Tên thông báo</param>
        /// <param name="_NoiDung">Nội dung</param>
        /// <param name="_HinhAnh">Hình ảnh ứng với thông báo: 1 Giúp đỡ || 2 Lỗi || 3 Thông tin || 4 Check </param>
        public static void TaoThongBaoOk(string _TenTB, string _NoiDung, int _HinhAnh)
        {
            frmThongbao = new FrmThongBaoOk();
            frmThongbao.ptbGiupDo.Visible = false;
            frmThongbao.ptbLoi.Visible = false;
            frmThongbao.ptbThongTin.Visible = false;
            frmThongbao.ptCheck.Visible = false;

            frmThongbao.Text = _TenTB;

            frmThongbao.lblNoiDung.Text = _NoiDung;

            switch (_HinhAnh)
            {
                case 1:
                    frmThongbao.ptbGiupDo.Visible = true;
                    break;
                case 2:
                    frmThongbao.ptbLoi.Visible = true;
                    break;
                case 3:
                    frmThongbao.ptbThongTin.Visible = true;
                    break;
                case 4:
                    frmThongbao.ptCheck.Visible = true;
                    break;
            }

            frmThongbao.ShowDialog();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void FrmThongBao_Resize(object sender, EventArgs e)
        {
            int _Rong = this.Size.Width;
            //int _Cao = this.Size.Height;
            //MessageBox.Show(_Cao.ToString() + ""+_Rong.ToString());

            //MessageBox.Show(_Cao.ToString() + " " + (_Cao - 22).ToString());
            btnOK.Location = new Point(_Rong / 2 - btnOK.Size.Width / 2, 85);
        }
    }
}
